package com.game.doudizhu.model;

import lombok.Data;
import javax.persistence.*;
import java.time.LocalDateTime;

@Data
@Entity
@Table(name = "system_settings")
public class SystemSettings {
    
    @Id
    @Column(name = "setting_key", length = 50)
    private String key;
    
    @Column(name = "setting_value", columnDefinition = "TEXT")
    private String value;
    
    @Column(name = "update_time")
    private LocalDateTime updateTime;
    
    @Column(name = "description", length = 200)
    private String description;
    
    @PrePersist
    @PreUpdate
    public void updateTimestamp() {
        updateTime = LocalDateTime.now();
    }
    
    // 构造函数
    public SystemSettings() {
    }
    
    public SystemSettings(String key, String value) {
        this.key = key;
        this.value = value;
    }
    
    public SystemSettings(String key, String value, String description) {
        this.key = key;
        this.value = value;
        this.description = description;
    }
} 